/*
 * $Id: BoxPanel.java 158 2009-05-22 12:22:12Z meyer@alphatec.de $
 * 
 *
 * Copyright 2009 DeltaDesk
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package deltadesk.gui.deltagui.widget.box;

import deltadesk.gui.deltagui.layout.GridLayout;
import deltadesk.gui.deltagui.widget.Composite;
import deltadesk.gui.deltagui.widget.Control;


/**
 * BoxPanel.
 * 
 * @author Andreas Meyer
 * @version $Revision: 158 $
 */
public class BoxPanel extends Composite {

	
	/**
	 * Construct the box panel.
	 * 
	 */
	public BoxPanel() {
		setLayout(new GridLayout());
		setInsets(5);
	}

	/**
	 * Construct the box panel.
	 * 
	 * @param rows
	 * @param cols
	 */
	public BoxPanel(final int rows, final int cols) {
		setLayout(new GridLayout(rows, cols));
		setInsets(5);
	}

	/**
	 * @see deltadesk.gui.deltagui.widget.Composite#add(deltadesk.gui.deltagui.widget.Control)
	 */
	@Override
	public final void add(final Control childControl) {
		
		final Box box = new Box();
		box.add(childControl);
		add(box);
	}

	/**
	 * @see deltadesk.gui.deltagui.widget.Composite#add(deltadesk.gui.deltagui.widget.AbstractControl)
	 */
	public final void add(final Box childControl) {
		super.add(childControl);
	}

}
